package com.pattern.structural.composite;

public class Document implements IDoc {
	
	private String docName;

	public Document(String docName) {
		this.docName = docName;
	}
	
	public int getCount() {
		return 1;
	}

	public void print() {
		System.out.println(docName);
	}

	public boolean add(IDoc doc) {
		throw new RuntimeException("叶节点无法添加文档...");
	}

	public boolean remove(IDoc doc) {
		throw new RuntimeException("叶节点无法删除文档...");
	}
}
